//#########################################################################
//                              WackiEngie
//           Copyright (c) 2014 Marc Wacker. All rights reserved.
//#########################################################################

#pragma once

#include "WeUtilPrerequisites.h"
#include "WeEvent.h"

namespace WackiEngine
{

	class LogEntry
	{
	public:
		LogEntry(const String& msg, const String& channel, const String& file, uint32 line);

		const String& getMsg() const { return _msg; }
		const String& getChannel() const { return _channel; }
		const String& getFile() const { return _file; }
		uint32 getLine() const { return _line; }
		double getTime() const { return _time; }

	private:
		String _msg;
		String _channel;
		String _file;
		int32 _line;
		double _time;

	};

	class Log
	{
	public:
		Event<void(const LogEntry&)> entryAdded;

		Log();
		~Log();

		void addEntry(const String& msg, const String& channel, const String& file, uint32 line);

		void clear();

	private:
		Vector<LogEntry*> _entries;
	};


}